import { mapToList } from '@/utils'
import type {MapProps} from '@/const'

// 发布审核状态
export const GOODS_AUDIT_STATUS_MAP: MapProps = {
	0: '待审核',
	1: '已通过',
	2: '未通过',
}
export const GOODS_AUDIT_STATUS_LIST = mapToList(GOODS_AUDIT_STATUS_MAP)

// 一口价商品状态
export const GOODS_STATUS_COLOR_MAP: MapProps = {
	0: '--warning-color',
	1: '--success-color',
	2: '--text-color-disabled',
	3: '--text-color-disabled',
	9: '--error-color',
}
// 一口价商品状态
export const GOODS_STATUS_OF_FIXED_PRICE_MAP: MapProps = {
	0: '待上架',
	1: '出售中',
	3: '已出售',
	9: '已下架',
}

// 拍卖的商品状态
export const GOODS_STATUS_OF_AUCTION_MAP: MapProps = {
	0: '待上架',
	1: '竞拍中',
	2: '已结拍',
	3: '已出售',
	9: '已下架',
}

export const GOODS_STATUS_OF_FIXED_PRICE_OPTIONS = mapToList(GOODS_STATUS_OF_FIXED_PRICE_MAP)
export const GOODS_STATUS_OF_AUCTION_OPTIONS = mapToList(GOODS_STATUS_OF_AUCTION_MAP)

export const GOODS_STATUS_MAP = (goodsType: 0 | 1, status: number) => {
	if (goodsType === 0) {
		return GOODS_STATUS_OF_FIXED_PRICE_MAP[status]
	} else {
		return GOODS_STATUS_OF_AUCTION_MAP[status]
	}
}
export const GOODS_STATUS_LIST = (goodsType?: 0 | 1) => {
	if (Number(goodsType) === 0) {
		return GOODS_STATUS_OF_FIXED_PRICE_OPTIONS
	} else {
		return GOODS_STATUS_OF_AUCTION_OPTIONS
	}
}

// 商品审核的状态
export const GOODS_STATUS_AUDIT_ACTION_LIST = [
	{
		label: '通过',
		value: 1
	},
	{
		label: '拒绝',
		value: 2
	},
]

export const GOODS_TYPE_MAP: MapProps = {
	0: '一口价',
	1: '竞拍'
}
// 交易管理 审核接口类型
export const GOODS_TYPE_LIST = mapToList(GOODS_TYPE_MAP)

export const READ_STATUS_MAP: MapProps = {
	0: '未读',
	1: '已读'
}

export const READ_STATUS_LIST = mapToList(READ_STATUS_MAP)
